// in src/App.tsx
import { Admin, Resource, ListGuesser, EditGuesser, ShowGuesser } from 'react-admin';

import { dataProvider } from './dataProvider/DataProvider';
import {authProvider} from "./dataProvider/AuthProvider"
import {i18nProvider} from "./i18n/i18nProvider"
import {ContactListPage} from "./page/ContactLog/ContactLogPage"
import { ContactEventPage } from './page/ContactEvent/ContactEventPage';
import { ContactEventCreateForm } from './page/ContactEvent/ContactEventCreateForm';

export const App = () => (
    <Admin 
            dataProvider={dataProvider} 
            authProvider={authProvider} 
            defaultTheme="light"
            requireAuth={true}
            i18nProvider={i18nProvider}
        >
        <Resource 
            options={{label:'通联演练管理'}} 
            name={import.meta.env.VITE_GET_CONTACT_EVENT_API_URI} 
            list={ContactEventPage} 
            create={ContactEventCreateForm}/>

        <Resource 
            options={{label:'通联纪录管理'}} 
            name={import.meta.env.VITE_GET_CONTACT_LOG_API_URI}  
            list={ContactListPage} />
    </Admin>
); 